* ange-ftp.el (ange-ftp-make-directory): Take second optional
authorJim Blandy <jimb@redhat.com>
Thu, 10 Jun 1993 11:39:44 +0000 (11:39 +0000)
committerJim Blandy <jimb@redhat.com>
Thu, 10 Jun 1993 11:39:44 +0000 (11:39 +0000)
argument parents, like the original.  Implement it.

lisp/ange-ftp.el

index 9b40a747b3a1f1c21f7631e02a0471903fa9a8e9..c895ce9fa269cfd7055fe5310fd36a9583b9a058 100644 (file)
@@ -856,7 +856,7 @@ SIZE, if supplied, should be a prime number."
 ;;;; Internal variables.
 ;;;; ------------------------------------------------------------
 
-(defconst ange-ftp-version "$Revision: 1.24 $")
+(defconst ange-ftp-version "$Revision: 1.25 $")
 
 (defvar ange-ftp-data-buffer-name " *ftp data*"
   "Buffer name to hold directory listing data received from ftp process.")
@@ -3546,8 +3546,12 @@ system TYPE.")
        (ange-ftp-del-hash-entry dir ange-ftp-files-hashtable)
        (ange-ftp-get-files dir t))))
 \f
-(defun ange-ftp-make-directory (dir)
+(defun ange-ftp-make-directory (dir &optional parents)
   (interactive (list (expand-file-name (read-file-name "Make directory: "))))
+  (if parents
+      (let ((parent (file-name-directory (directory-file-name dir))))
+       (or (file-exists-p parent)
+           (ange-ftp-make-directory parent parents))))
   (if (file-exists-p dir)
       (error "Cannot make directory %s: file already exists" dir)
     (let ((parsed (ange-ftp-ftp-name dir)))